#include "DeviceLibrary.h"

int main() {
    // 创建设备
    RegularDevice regular("RD-202", 220.5f, 10.2f, 1);
    SmartDevice smart("SD-305", 380.0f, 25.1f, 3, 8, 1);
    // 创建控制器
    auto controller = createDeviceController();
    // 多态调用 打印设备信息
    std::cout << "Initial Device Status:\n";
    controller->control(regular);
    controller->control(smart);
    // 调用智能设备的电压调整
    std::cout << "Adjusting Voltage:\n";
    smart.autoAdjustVoltage(400.0f);
    controller->control(regular);
    controller->control(smart);

    // 调整智能设备电压
    // std::cout << "\nAdjusting Voltage:\n";
    // controller->adjustVoltage(smart, 420.0f);
    // controller->adjustVoltage(regular, 230.0f);
    // controller->control(regular);
    // controller->control(smart);
    return 0;
}